#ifndef KCP_SEND_H
#define KCP_SEND_H

#include "KcpCommon.h"
#include "ringflow.h"

#define PACKET_SEND_MAX_COUNT 3

class KCPSender : public KcpCtx
{
public:
    KCPSender();
    ~KCPSender();
    int InitSender(const char* local_ip, int local_port, const char* remote_ip, int remote_port);
    void Close();
    int SendData(const char* data, int len) {
        return rbuf_write(m_RingFlow, (char *)data, len);
    }

private:
    static void* SendDataThread(void *arg);

private:
    bool m_IsRunning;
    pthread_t m_Thread_id;
    rflow_t *m_RingFlow;
    char *m_Buffer;
};

#endif /* KCP_RECEIVER_H */